//
//  create_enc_service_request.cpp
// ~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2013-2014 Razvan Coca (razvan dot coca at  gmail dot com)
// This is mostly generated code. Generator is distributed under GPL. Edit it to suit your needs.
// 



#include "create_enc_service_request.hpp"
#include <boost/bind.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/enable_shared_from_this.hpp>
#include <boost/asio.hpp>

#include "patterns/command.hpp"
#include "patterns/handlers.hpp"

#include "logging/logging.hpp"

namespace pcmd=patterns::command;
namespace phdl=patterns::handlers;
namespace ba=boost::asio;
namespace bs=boost::system;
namespace bt=boost::posix_time;

#include "components/defs/util_types.hpp"
#include "components/defs/client_processor.hpp"
#include "components/protocol/create_enc_service_request.hpp"
namespace components{
namespace protocol{


bool create_enc_service_request::cancel()
{

    try{
        bool retcode=true;
        LOG(WARNING)<<name_<<"::"<<__FUNCTION__;
        return retcode;
    }
    catch(std::exception &e){
        LOG(WARNING)<<name_<<"::"<<__FUNCTION__<<":"<<e.what();
        return false;
    }


}

boost::shared_ptr<create_enc_service_request> create_enc_service_request::create(ba::io_service& ios, crypto_buf_t& iv, crypto_buf_t& key,
                                                                                 stats_message_client_processor &message_processor)
{

    return boost::shared_ptr<create_enc_service_request>(new create_enc_service_request(ios,iv,key,message_processor));
}

create_enc_service_request::create_enc_service_request(ba::io_service& ios, crypto_buf_t& iv, crypto_buf_t& key,
                                                       stats_message_client_processor &message_processor)
    :ios_(ios), iv_(iv), key_(key),message_processor_(message_processor)
{

    name_=std::string(__FUNCTION__);
    DLOG(INFO)<<name_<<"()";

    aes_service_=components::encrypt::aes_service::create(ios_);
    //aes_service_->enc_key(iv_,key_);
    //aes_service_->dec_key(iv_,key_);

}

create_enc_service_request::~create_enc_service_request()
{
    DLOG(INFO)<<name_<<"::"<<__FUNCTION__<<std::endl;
}
}//end namespace protocol
}//end namespace components

